<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vertical Centering</title>
  <style>
    .container {
      display: flex;
      align-items: center; /* 垂直居中 */
      justify-content: center; /* 水平居中（可选） */
      height: 200px; /* 设置一个固定高度 */
      border: 1px solid #000; /* 可视化边界 */
    }
  </style>
</head>
<body>
  <div class="container">
    这是一段可能多行的文字，无论多少行都能垂直居中。Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit voluptatem, dicta tenetur ducimus unde ipsa ipsam, placeat quas illo fugit nemo quae ut quam? Fuga obcaecati natus voluptatum laudantium accusamus.
  </div>
</body>
</html>